<%@ page language="java" pageEncoding="UTF-8"%>
<%@ taglib uri="http://jakarta.apache.org/struts/tags-bean" prefix="bean"%> 
<%@ taglib uri="http://jakarta.apache.org/struts/tags-html" prefix="html"%>
<%@ taglib uri="WEB-INF/c.tld" prefix="c"%>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">


<html:html locale="true">
	<head>
		<meta http-equiv="content-type" content="text/html; charset=utf-8" />
		<title>Quiz HomePage</title>
		<link href="default.css" rel="stylesheet" type="text/css" />
	</head>

<body>
<div id="header">
	<div id="logo">
		<h1><a href="#">Quiz</a></h1>
	</div>
	<div id="menu">
		<ul>
			<li><a></a></li>
		</ul>
	</div>
</div>

<c:if test="${loggedUser != null}">
<html:form action="/quiz" method="post">
<div id="content">
	<div id="sidebar">
		<div id="login" class="boxed">
			<div class="title">
		  		<h2>Ranking - Top 5</h2>
			</div>
			<div class="content">
				<fieldset>
				   <c:forEach items="${topList}" var="rank" >
						<label for="inputtext1"><b><c:out value="${rank.user.login}"/>&nbsp;<c:out value="${rank.hit}"/></b></label>
				   </c:forEach>		
				</fieldset>
			</div>
		</div>
		<!-- end #login -->
	</div>
	<!-- end #sidebar -->
	<div id="main">
		<div id="welcome" class="post">
			<h2 class="title"><span>É aqui que você realiza seus quizes</span></h2>
			<div class="story">
  			<c:if test="${questionList != null}">
  			${question}<br/><br/><br/><br/><br/>
  			
  			<% int i=1; %>
			  <c:forEach items="${altList}" var="q">
				  <label for="inputtext1"><b><input type="radio" name="alternative" value="<%=i++%>"><c:out value="${q}"/></b></label>
				  <br/>
              </c:forEach>
              <br/>
              <html:submit property="next" value="Seguir"/>  			
  			</c:if>
  			<c:if test="${questionList == null}">
  				Clique no botão abaixo para realizar mais um teste, ou realizar seu primeiro! ;)<br/><br/><br/>
				<html:submit property="next" value="Novo Quiz"/>  			
  			</c:if>
  
			</div>
		</div>
		<!-- end #welcome -->
	</div>
	<!-- end #main -->
	<div id="sidebar2">
		<div id="sponsors" class="boxed">
			<div class="title">
				<h2>Links relacionados</h2>
			</div>
			<div class="content">
				<ul>
					<li> <a href="http://java.sun.com">Sun</a></li>
					<li> <a href="http://www.guj.com.br">GUJ </a></li>
					<li> <a href="http://www.mundojava.com.br">Mundo Java </a></li>
					<li> <a href="http://www.javamagazine.com.br">JavaMagazine </a></li>
				</ul>
			</div>
		</div>
		<!-- end #sponsors -->
	</div>
	<div style="clear: both;">&nbsp;</div>
	<a href="../<%=request.getContextPath()%>/index.jsp">Sign Out</a>	
</div>
</html:form>
<!-- end #sidebar2 -->&nbsp;
<div id="footer">
	<p id="legal">Copyright &copy; 2008. All Rights Reserved. Designed by <a href="http://www.freecsstemplates.org/">Free CSS Templates</a>.</p>
</div>

</c:if>
<c:if test="${loggedUser == null}">
	<div align="center">
	<c:out value="Você precisa realizar seu login para visualizar esta página!"/>
	</div>
</c:if>
</body>
</html:html>